<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>后台管理</title>
<link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../js/bootbox.min.js"></script>
</head>
<body class="container">
	<div class=" panel panel-warning ">
		<div class="panel-heading" id="palHead">
			<h3 class="panel-title">后台管理</h3>
		</div>
		<div class="panel-body">

			<div class="list-group ">
				<a href="usermanager.html" class="list-group-item list-group-item-warning">查看所有用户</a> <a href="alladmins.html" class="list-group-item list-group-item-warning">查看所有管理员</a>
				<button id="btnAdd" type="button" class="list-group-item list-group-item-warning">新增管理员</button>
			</div>

		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			var qx;
			$.ajax({
				url : "../../adminsession",
				async : false,
				type : "GET"
			}).done(function(result) {
				qx = result;
			});
			
			if (qx == "0") {
				window.location.href = "../noauthority.html";
				return;
			}
			if (qx == "1") {
				$("#btnAdd").hide();
			}

			function getQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg);
				if (r != null)
					return unescape(r[2]);
				return null;
			}
			var username = getQueryString("username");
	
	
			$(document).attr("title", "欢迎 " + username);
			$("#palHead").text("欢迎 " + username);

			$("#btnAdd").on("click", function() {

				window.open("addadmin.html");
				return false;
			});
		});
	</script>
</body>
</html>